
public class Date {

    public int year;
    public int month;
    public int day;

    public void setDate(int year,int month,int age)
    {
        this.year=year;
        this.month=month;
        this.day=day;
    }
    public Date()
    {
        this(2022,11,7);
        System.out.println("不带参数：");
    }

    public Date(int year,int month,int day)
    {
        this.year=year;
        this.month=month;
        this.day=day;
        System.out.println("3个参数：");
    }
    public void show()
    {
        System.out.println("年："+this.year+" 月："+this.month+" 日："+this.day);
    }
    public static void main(String[] args) {
        Date date=new Date();
        Date date1=new Date(2022,11,7);
//        date.year=2022;
//        date.month=11;
//        date.day=7;
        date.show();
        System.out.println("==============");
        date1.show();
    }
}
